package com.xbjtech.ticketsystem.model;

import com.google.gson.annotations.SerializedName;
import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Set;

/**
 * @author leejun.happy@gmail.com
 * @created 2019/2/20
 */
@Data
@Table(name = "t_resource")
public class Resource implements Serializable {

    private static final long serialVersionUID = 2991602538504830238L;

    @Id
    @KeySql(useGeneratedKeys = true)
    @Column(name = "mid")
    private Integer id;

    @Column(name = "mname")
    private String name;

    private String permission;

    private String icon;

    private String url;

    /**
     * type = 0 菜单
     * type = 1 按钮
     */
    private Integer type = 0;

    @SerializedName("_parentId")
    private Integer parentId;

    private Integer sort;

    @Transient
    private Set<Role> roles;
}
